<?php
//function created (uses for checking all checkbox) which is in /js/custom_scripts.js
    echo $this->Html->script('custom_scripts');
?>
<?php if(empty($bbs)){ echo 'Dữ liệu bạn nhập không tìm thấy';} else {?>

 <?php echo $this->Form->create('Thuyetminh',array('url'=>'thembb'));?>

<table cellpadding="0" cellspacing="0">
	<tr>
			<th><input type="checkbox" onclick="checkAll(this);" /></th>
			<th><?php echo 'STT';?></th>
			<th><?php echo 'Tên công văn';?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($bbs as $k=>$v):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}

	?>
	<tr<?php echo $class;?>>
	 <?php
	echo '<td width="10%"><input type="checkbox" value="'.$k.'" 
            name="data[Thuyetminh][id][]" id="'.$i.'" ></td>';
    ?>
		<td><?php echo $i; ?>&nbsp;</td>
		<td><?php echo $v; ?>&nbsp;</td>
	
	</tr>
<?php endforeach; ?>
	</table>
<div class="button" align="center"><?php echo $this->Form->end(__('Thêm công văn vào công trình', true));?>
</div>
<?php }?>